﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="frmMainDesktop.aspx.cs" Inherits="frmMainDesktop" %>

<%@ Import Namespace="System.Data" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>jquery-ui制作酷炫个性的desktop桌面</title>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
    <meta name="description" content="jquery-ui制作酷炫个性的desktop桌面特效展示支持各大主流浏览器IE6以上" />

    <script type="text/javascript" src="ScriptFile/jquery.js"></script>

    <script type="text/javascript" src="ScriptFile/desktopLib.js"></script>
    <script src="ScriptFile/Common/Jquery.Global.js"></script>
    <script src="ScriptFile/Common/Jquery.Common.js"></script>
</head>
<body>
    <%--<a class="powered_by">Powered by cjkj</a>--%>
    <div id="wallpapers">
    </div>
    <div style="text-align: center">
        <div id="navBar">
        </div>
    </div>

    <div style="margin-top: 32px; width: 1203px; margin-bottom: 75px; height: 771px; margin-left: 73px"
        id="desktopPanel">
        <div style="width: 5104px; height: 771px" id="desktopInnerPanel">
        </div>
    </div>
    <!--desktopPanel end-->
    <div id="taskBarWrap">
        <div style="width: 1200px" id="taskBar">
            <div id="leftBtn">
                <a href="#"></a>
            </div>
            <div id="rightBtn">
                <a href="#"></a>
            </div>
            <div id="task_lb_wrap">
                <div id="task_lb">
                </div>
            </div>
        </div>
    </div>
    <!--taskBarWrap end-->
    <div style="margin-top: 200px" id="lr_bar">
        <ul id="default_app">
            <li id="app0"><span>
                <img title="通知公告" src="images/icon/icon1.png"></span>
                <div class="text">
                    通知公告<s></s>
                </div>
            </li>
            <li id="app1"><span>
                <img title="用户修改" src="images/icon/icon2.png"></span>
                <div class="text">
                    用户修改<s></s>
                </div>
            </li>
            <li id="app2"><span>
                <img title="文件接收" src="images/icon/icon3.png"></span>
                <div class="text">
                    文件接收<s></s>
                </div>
            </li>
        </ul>
        <div id="default_tools">
            <span id="btnScreen" title="全屏"></span><span id="them_btn" title="主题"></span>
        </div>
        <div id="start_block">
            <a id="start_btn" title="开始"></a>
            <div id="start_item">
                <ul class="item admin">
                    <li><span class="sitting_btn"></span>系统设置</li>
                </ul>
                <ul class="item">

                    <li><span class="help_btn"></span>使用指南 <b></b></li>
                    <li><span class="about_btn"></span>关于我们</li>
                    <li><span class="logout_btn"></span>退出系统</li>
                </ul>
            </div>
        </div>
    </div>
    <!--lr_bar end-->
    <div style="position: absolute; width: 1px; height: 1px; visibility: hidden; overflow: hidden; top: 0px; left: 0px">
    </div>
    <div style="position: absolute; width: 1px; height: 1px; visibility: hidden; overflow: hidden; top: 0px; left: 0px">
    </div>
    <script type="text/javascript">

        var deskIconData = "";
        var strChildHtml = "";
        //获取父菜单信息
        function GetParentMenus() {
            WebService(Common.GetServicePath() + "MOAService.asmx/GetParentMenu", ShowParentMenus, '{}');
        }

        //生成父菜单
        function ShowParentMenus(json) {
            if (json == "") {
                return "";
            }
            json = json.toJson(); //格式化

            var strParentHtml = "";
            var strChildHtml = "";
            for (var i = 0; i < json.length; i++) {
                var tempRow = json[i];

                var menuid = tempRow["menu_parent_id"].toString();
                var menuname = tempRow["menu_parent_desc"].toString();
                if (i == 0) {
                    strParentHtml += "<a class=\"currTab\" title=\"" + menuname + "\" href=\"javascript:void(0)\" rel=\"" + menuid + "\"></a>";
                }
                else {
                    strParentHtml += "<a title=\"" + menuname + "\" href=\"javascript:void(0)\" rel=\"" + menuid + "\"></a>";
                }

                //生成子菜单
                WebService(Common.GetServicePath() + "MOAService.asmx/GetChildMenuList", ShowChildMenus, "{'strId':'" + menuid + "'}");
            }
            $("#navBar").html(strParentHtml);
        }


        //生成子菜单
        function ShowChildMenus(json) {
            if (json == "") {
                return "";
            }
            json = json.toJson(); //格式化

            strChildHtml += "<ul style=\"width: 1203px; height: 771px; margin-right: 73px\" class=\"deskIcon\">";
            for (var i = 0; i < json.length; i++) {
                var tempRow = json[i];
                var newMenuId = tempRow["menu_child_id"].toString();
                var newMenuTitle = tempRow["menu_child_desc"].toString();
                var newMenuUrl = tempRow["linkhref"].toString();
                var newMenuPic = tempRow["overpic"].toString();
                strChildHtml += "<li style=\"position: absolute; margin: 0px; top: " + (i + 1) * 70 + "px; left: 30px\" id=\"" + newMenuId + "\" class=\"desktop_icon\"><span class=\"icon\"><img src=\"" + newMenuPic + "\"></span><div class=\"text\">" + newMenuTitle + "<s></s></div></li>";

                if (deskIconData.length > 0) {
                    deskIconData += ",";
                }
                deskIconData += "'" + newMenuId + "':{'title':'" + newMenuTitle + "','url':'" + newMenuUrl + "','winWidth':950,'winHeight':500}";
            }
            //strChildHtml += "<li style=\"position: absolute; margin: 0px; top: 140px; left: 150px\" class=\"desktop_icon\"><span class=\"icon\"><img src=\"images/add_icon.png\"></span><div class=\"text\">添加<s></s></div></li>";
            strChildHtml += "</ul>";

            $("#desktopInnerPanel").html(strChildHtml);
        }


        $(function () {
            myLib.progressBar();
            GetParentMenus();
        });

        $.include(['css/desktop.css', 'css/jquery-ui.custom.css', 'css/smartMenu.css', 'ScriptFile/JqueryUi/jquery.ui.core.js', 'ScriptFile/Common/jquery.winResize.js', 'ScriptFile/Common/jquery-smartMenu-min.js', 'ScriptFile/desktop.js']);
        $(window).load(function () {
            myLib.stopProgress();
            var lrBarIconData = {
                'app0': {
                    'title': 'jsfoot网页特效',
                    'url': 'http://www.jsfoot.com/',
                    'winWidth': 1100,
                    'winHeight': 650
                },
                'app1': {
                    'title': 'jQuery特效',
                    'url': 'http://www.jsfoot.com/jquery/',
                    'winWidth': 1100,
                    'winHeight': 650
                },
                'app2': {
                    'title': 'javascript特效',
                    'url': 'http://www.jsfoot.com/ScriptFile/',
                    'winWidth': 1100,
                    'winHeight': 650
                },
                'app3': {
                    'title': '资源分享',
                    'url': 'ziyuan.html',
                    'winWidth': 1100,
                    'winHeight': 650
                }
            };

            //存储桌面布局元素的jquery对象
            myLib.desktop.desktopPanel();

            //初始化桌面背景
            myLib.desktop.wallpaper.init("images/blue_glow.jpg");

            //初始化任务栏
            myLib.desktop.taskBar.init();

            //初始化桌面图标
            if (deskIconData != "") {
                //desonIconData = '[' + deskIconData + ']'; alert(desonIconData);
                //var aryTemp = jQuery.parseJSON(desonIconData);

                var aryTemp = {<%=strIconData%> };
                myLib.desktop.deskIcon.init(aryTemp);
            }

            //初始化桌面导航栏
            myLib.desktop.navBar.init();

            //初始化侧边栏
            myLib.desktop.lrBar.init(lrBarIconData);


            //欢迎窗口
            myLib.desktop.win.newWin({
                WindowTitle: '欢迎窗口',
                iframSrc: "Xnjc/WorkflowStatus.aspx",
                WindowsId: "welcome",
                WindowAnimation: 'none',
                WindowWidth: 740,
                WindowHeight: 520
            });

        });
    </script>
</body>
</html>
